home *** CD-ROM | disk | FTP | other *** search
/ Web Designer 98 (Professional) / WebDesigner 1.0.iso / cgi2 / download.cgi-s=guestbook&c=txt&f=readme < prev    next >
Text File  |  1996-06-03  |  18KB  |  295 lines

  1. ##############################################################################
  2. # Guestbook                     Version 2.3.1                                #
  3. # Copyright 1996 Matt Wright    mattw@worldwidemart.com                      #
  4. # Created 4/21/95               Last Modified 10/29/95                       #
  5. # Scripts Archive at:           http://www.worldwidemart.com/scripts/        #
  6. ##############################################################################
  7. # If you run into any problems while trying to configure this scripts, help  #
  8. # is available.  The steps you should take to get the fastest results, are:  #
  9. #       1) Read this file thoroughly                         #
  10. #       2) Consult the Matt's Script Archive Frequently Asked Questions:     #
  11. #               http://www.worldwidemart.com/scripts/faq/             #
  12. #       3) If you are still having difficulty installing this script, send   #
  13. #          e-mail to: scripts-help@tahoenet.com                     #
  14. #          Include any error messages you are receiving and as much detail   #
  15. #          as you can so we can spot your problem.  Also include the variable#
  16. #          configuration block that is located at the top of the script.     #
  17. #                                         #
  18. # Hopefully we will be able to help you solve your problems.  Thank you.     #
  19. ##############################################################################
  20. # COPYRIGHT NOTICE                                                           #
  21. # Copyright 1996 Matthew M. Wright  All Rights Reserved.                     #
  22. #                                                                            #
  23. # Guestbook may be used and modified free of charge by anyone so long as     #
  24. # this copyright notice and the comments above remain intact.  By using this #
  25. # code you agree to indemnify Matthew M. Wright from any liability that      #  
  26. # might arise from it's use.                                                 #  
  27. #                                                                            #
  28. # Selling the code for this program without prior written consent is         #
  29. # expressly forbidden.  In other words, please ask first before you try and  #
  30. # make money off of my program.                                              #
  31. #                                                                            #
  32. # Obtain permission before redistributing this software over the Internet or #
  33. # in any other medium.    In all cases copyright and header must remain intact.#
  34. ##############################################################################
  35.  
  36. There are five files included in the Guestbook package.  Below is a brief 
  37. summary of them:
  38.         1) README - This file.
  39.         2) guestbook.pl - The Perl Script.
  40.         3) guestbook.html - The actual guestbook file.
  41.         4) addguest.html - The fill-out form for a guestbook entry.
  42.         5) guestlog.html - A short log of those who have added.
  43.  
  44. Below is a more detailed explanation of each file and what to do with it!
  45. ____________________
  46.  
  47. GUESTBOOK.PL - This is the Perl script that actually writes new entries to 
  48. files and returns the entry to the user.  This file will need to be placed
  49. in the cgi-bin of your server and chmoded to a+rx.  There are a few things 
  50. that need to be changed in this file:
  51.         # Set Variables
  52.         $guestbookurl - The url address of your guestbook.html file
  53.         $guestbookreal - The system location of your guestbook.html file
  54.         $guestlog - The system location of your guestlog.html file
  55.         $cgiurl - The url portion of the address to the guestbook.pl file
  56.      The file guestbook.pl needs to be placed in your server's cgi-bin and 
  57. chmoded read/execute for users of your httpd. (chmod a+rx)
  58.  
  59.     NEW IN 2.1:
  60.                 There are now several options that you have to decide whether
  61.     or not to use.  Below is a brief description of what each one does.  
  62.     While choosing what options you want to have on keep in mind that a '1' 
  63.     will turn them on and a '0' will turn them off.
  64.         Option 1:  $mail - This option will allow you to be notified via 
  65.            an E-Mail address when a new entry arrives in your guestbook.  
  66.            The entry will be mailed to you as a notification.  If you should 
  67.            choose to turn this variable on you will need to fill in the 2 
  68.            variables that go along with it:
  69.                 $recipient - Your E-Mail address, so that the mailing 
  70.                     program will know who to mail the entry to.
  71.                 $mailprog - The location of your sendmail program on your 
  72.                     host machine.
  73.         Option 2:  $uselog - This will allow you the ability to use my 
  74.            short log feature.  It is already turned on so you will have to 
  75.            change it to 0 if you do not wish to use it. I have implemented 
  76.            this feature, since there are probably many people who feel no need
  77.            to have a log when people are making entries to a file anyway.  
  78.            Keep in mind it will show errors which is one nice aspect about it.
  79.         Option 3:  $linkmail - Turning this option on will make the 
  80.            address links in your guestbook become hyperlinked.  So instead of
  81.            simply having (name@some.host) it will put 
  82.            (<a href="mailto:name@some.host">name@some.host</a>) so that anyone 
  83.            can simply click on the address to email them.
  84.         Option 4:  $separator - While looking at many other guestbooks 
  85.            I noticed that many people prefer to separate entries with 
  86.            a Horizontal Rule <hr> instead of a Paragraph Separator <p>, which 
  87.            I used in my old scripts.  I have now given you the option to 
  88.            choose.  By changing the 0 in the script to a 1 you will turn on 
  89.            the <hr> separator and turn off the <p> separator.  The 0 option 
  90.            will do the reverse of that; turn on <p> and turn off <hr>.
  91.         Option 5: $redirection - Although Netscape and other browsers handle 
  92.            the auto-redirection that I have implemented quite nicely, I have
  93.            noticed that it does not work with lynx (a text based browser). 
  94.            I have given you the option of using auto-redirection or not.  
  95.            Lynx can still add to your guestbook with it, they will just get an 
  96.            error message when they do.  This may not be true for all systems 
  97.            though.  It seemed that when we upgraded to httpd 1.4 this problem 
  98.            started occurring.  By choosing 1 you will enable auto redirection 
  99.            and 0 will return a page to the user telling them their entry has 
  100.            been received and click here to get back to the guestbook.
  101.  
  102.     NEW IN 2.2:
  103.                 There are a couple new options in version 2.2, which you will
  104.            need to configure, or leave as default.
  105.  
  106.         Option 6: $entry_order - When this script was first written, entries 
  107.            were always added next to the top, so you and other users did not
  108.            have to always see the same guestbook entry when they visited your
  109.            pages.  The rest of the enties scrolled beneath the newest, from
  110.            newest to oldest.  I have had requests that I make an option
  111.            available so that people can have a guestbook which would read
  112.            from oldest to newest.  This is how you would go about doing that.
  113.            Set this option to '0' and the newest entries will be added below
  114.            the rest of the entries.  Keep this option at '1' and the guestbook
  115.            will act like previous versions, adding the newest entry to the top.
  116.         Option 7: $remote_mail - Many users of the guestbook have requested 
  117.            that a form letter be automatically sent to the remote user when
  118.            they fill in the guestbook.  Turning this option on will tell the
  119.            script to automatically mail any user who leaves an email address.
  120.            You can specify the contents of the mail mesage by editing the
  121.            section of the script that sends mail to the remote user.  By 
  122.            default it sends a message that says, "Thank you for adding to my 
  123.            guestbook." and then shows them their entry.  If you should
  124.            choose to turn this variable on you will need to fill in the 2
  125.            variables that go along with it:
  126.                 $recipient - Your E-Mail address, so that the mailing
  127.                     program will know who to mail the entry to.
  128.                 $mailprog - The location of your sendmail program on your
  129.                     host machine.
  130.  
  131.         NEW IN 2.3!
  132.                 There is one new configurable option in version 2.3 of the 
  133.            guestbook.
  134.  
  135.         Option 8: $allow_html = "";
  136.            This option allows you to turn on or off the use of HTML tags by 
  137.            users of your guestbook.  Setting this variable to '1' allows 
  138.            users to imbed html tags such as <b> or <H1> or <a href=""></a> 
  139.            into your html document.  Setting this variable to '0' will not 
  140.            allow them to use any html syntax in their comments or any other 
  141.            field.  You can still link to their email address by turning 
  142.            $link_mail to '1'.
  143.  
  144.         Also new in version 2.3 is the ability for users to add their own url 
  145.         and then their name is referenced to their URL in the guestbook.html 
  146.         file.  This helps to eliminate the need for allow_html to be turned 
  147.         on, and lets users point you to a spot that will tell you more about 
  148.         them. Several users of the guestbook script have asked for this 
  149.         option.  If you wish to disable the option, simply delete the 
  150.         following line from your addguest.html file:
  151.        
  152.                 URL: <input type=text name=url size=50><br>
  153.  
  154.  
  155.     NEW IN 2.3.1!
  156.  
  157.     Option 9: $line_breaks - This option allows you to decide whether 
  158.        or not you want line breaks in the comment field to be turned into 
  159.        <br>'s in the html thing to retain the look of the guestbook entry.  
  160.        Common setting would be off, because sometimes people accidentally 
  161.        put in extra line breaks.
  162.  
  163. ____________________
  164.  
  165.  
  166. GUESTBOOK.HTML - This is the file that you will link to that will contain the 
  167. Guestbook Entries.  You will need to have this set at write/read permission 
  168. for the users (chmod a+rw).  You will probably need to edit the url for the 
  169. link to the addguest.html file and edit the url at the end of this page to 
  170. point back to your home page.  You will also want to edit the title and 
  171. heading spaces.  Do not delete the line <!--begin--> from this 
  172. guestbook, or else the script will have no way of knowing where to begin the 
  173. editing.  The <!--begin--> line is the only necessary line in your 
  174. guestbook.html file, but the link to the addguest.html file is also a good 
  175. idea.  :)
  176. ____________________
  177.  
  178. ADDGUEST.HTML - This is a fill-out form to add a new entry into the 
  179. guestbook.  You will need to edit parts of it to correct urls and 
  180. names of things, but leave the basic field names in place in the form.  You 
  181. will also need to change the action of the form to point to the guestbook.pl 
  182. file you placed in your cgi-bin.  The action of the form should be the same 
  183. as the $cgiurl variable you configured in your guestbook.pl file.
  184. ____________________
  185.  
  186. GUESTLOG.HTML - This is a short log that lists domains and times that entries 
  187. were created.  Much easier to browse and it will point out those failed entries 
  188. when users did not specify a name or comments.  This file will also need 
  189. read/write permission given to it.  To avoid long scripting (call me lazy if 
  190. you want :-) ) I left the log file so that newest entries are added at the 
  191. bottom.  This should be apparent though since the entries all come with a 
  192. short date added.  You can get around using this by changing the option 
  193. $uselog in the guestbook.pl file.
  194. ____________________
  195.  
  196. Bug Fixes in Version 2.1:
  197.         1) I changed the guestbook script so that the subroutines now work.
  198.            I guess I really messed up in Version 2.0, since I didn't test it
  199.            well, so I tried to be extra careful this time.
  200.         2) In the subroutines I added a complete new form so that people 
  201.            who forget to put their name in can simply fill it in, while the 
  202.            script retains the rest of the information and it will them be 
  203.            added.  This means that they don't have to first return to the 
  204.            guestbook add form to fill out the entry all over again.
  205.  
  206. Bug Fixes in Version 2.2:
  207.         1) I seemed to have a huge parenthesis problem in version 2.1. I 
  208.            messed up twice in the mail option and also in the guestbook
  209.            printing, when the ')' was put inside the <a href> mailto tag, 
  210.            instead of outside like the first one.  The mail option was
  211.            missing two parenthesis which caused it not to work on many 
  212.            machines.  These have both been fixed.
  213.         2) <>'s were used instead of () in the guestbook email addresses.
  214.  
  215. Bud fixes in Version 2.3:
  216.         1) Fixed Server Side Includes Security whole in script.
  217.  
  218. -------------------------------------------------------------------------------
  219.  
  220. Distribute this freely, but please leave my name and address somewhere in it.  
  221. Not necessarily in the Guestbook, but somewhere in the script.  I cannot 
  222. guarantee the safety or integrity of this package, I only did my best.  It is 
  223. being used many places and people seem to like it.
  224.  
  225. I would love to see improvements on this and if you happen to have an idea or 
  226. make the changes, please let me know or send me a copy.  If you have any 
  227. comments or suggestions you can reach me at the email address at the top of 
  228. this document.  I would appreciate any feedback or info you have for me.  
  229. Thanks.
  230.  
  231. One thing that I do ask is that you let me know the url of where this is being 
  232. used.  I won't be mad if I don't, but it is nice to see my work on the WWW.  
  233. Also by letting me know this and your email address I guess this is all I need 
  234. to know to consider you registered and then I will be able to let you know of 
  235. updates to the scripts, etc...
  236.  
  237. -------------------------------------------------------------------------------
  238.  
  239. History List:
  240. Version 1.1       5/13 - chop($shortdate); added to make log file more 
  241.                          readable...
  242. Version 2.0       5/26 - Several lines of code added and modified so that 
  243.                          entries now appear most recent entry first.
  244.                        - Many lines taken out so that the script automatically 
  245.                          returns you to the guestbook after you have completed 
  246.                          the add form.
  247. Version 2.1       5/29 - Edited subroutines so that they now work.  Added fill 
  248.                          out form to the subroutines to make less jumps to fill
  249.                          out guestbook.
  250.                   6/1  - Added the option of mailing the owner of the guestbook
  251.                          when a new entry arrives.
  252.                   6/5  - Added the option to hypertext the email address of the
  253.                          guest and you can now choose whether to log the entry 
  254.                          or not.
  255.                   6/7  - chop($date); added and the guestbook entry modified.
  256. Version 2.2       8/23 - Tiny Modifications:
  257.                               - Parenthesis for email address in entry 
  258.                                 changed to brackets, so that the email address 
  259.                                 can more easily be cut and pasted into most 
  260.                                 email programs.
  261.                        - Other minor changes
  262.                   8/24 - Logging now a subroutine.
  263.                        - Code tabbed better to make more readable.  This was 
  264.                          one of my worst scripts up until now in that respect.
  265.                        - Option to have newest entries displayed at the bottom 
  266.                          instead of at the top added.
  267.                        - E-mail option now fixed so the names come through 
  268.                          with the email messages.
  269.                        - Modified the subroutines, so when an error message is 
  270.                          submitted, people don't see just a 2 letter field for 
  271.                          the State.  I guess I was just ignorant before, not 
  272.                          realizing this would be around the world, where not 
  273.                          everyone uses 2 digits for their state.  :)
  274. Version 2.21     10/8  - Fixed a problem with logging entry, which caused the 
  275.                          log to be on one line when viewed with a WWW browser.
  276. Version 2.3      10/14 - Added option of allowing html tags or throwing them 
  277.                          out when an entry was added.
  278.                        - Fixed a hole in the script, which, when html is 
  279.                          turned on, like it always used to be, people could 
  280.                          add random server side includes to your html pages.
  281.                          Not cool. Thanks to:
  282.                          Rick O'Donnell (odonnell@heron.tc.clarkson.edu)
  283.                          for pointing out the flaw and providing a fix.
  284.                        - Added an optional URL field in the add an entry form 
  285.                          and modified the script to place the reference 
  286.                          around the submitter's name.
  287. Version 2.3.1     10/29 - Took out all references to $server, which were 
  288.              accidentally left in version 2.3.
  289.                - Added an option to let you change line breaks in 
  290.              comment field to <br>'s in html doc.
  291.                - Added several die routines so maybe I won't get 
  292.              as many mail messages as to "Why doesn't this work!"
  293. ______________________________________________________________________________
  294. Matt Wright - mattw@worldwidemart.com - http://www.worldwidemart.com/scripts/
  295.